// 请求发送处
import service from "./config";

// 获取所有商品
export const getProduct = (product_id = "") => service.get("/product/get_product");

// 获取所有类目
export const getCategory = () => service.get("/category/getCategory");

// 添加商品
export const addProduct = (params) => service.post("/product/add_product", { ...params });

// 删除商品
export const delProduct = product_id => service.get(`/product/del_product?product_id=${product_id}`);

// 修改商品
export const updateProduct = product_id => service.post("/product/update_product", { product_id });

// 登录
export const login = (username, password) => service.post("/users/login", { username, password });